# -*- coding: utf-8 -*-
# File:main_page.py
# Time: 
# Author : xingtiantian
"""
1、登录
2、进入通讯录页面 - 点击通讯录
"""
import allure
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions

from qiyeweixin.base.basepage import BasePage
from qiyeweixin.pages.contact_page import ContactPage
from qiyeweixin.utils.log import logger


class MainPage(BasePage):
    _CONTACT_BTN = (By.ID, "menu_contacts")
    # _ADD_MEMBER_BTN = By.XPATH, '//div[@class="ww_operationBar"]//a[contains(@class,"js_add_member")]'

    @allure.step("点击通讯录，进入通讯录页面")
    def goto_contact(self):
        self.find_ele_click(*self._CONTACT_BTN)  # 点击通讯录
        logger.info(f"点击通讯录，进入通讯录页面")
        return ContactPage(self.driver)

    # def goto_add_member(self):
    #     """
    #     进入添加成员页面
    #     :return:
    #     """
    #     with allure.step("点击添加成员，进入添加成员页面"):
    #         self.find_ele_click(*self._ADD_MEMBER_BTN)
    #     return AddMemberPage(self.driver)
